Add .cci.jenkinsfile
authorColin Walters <walters@verbum.org>
Mon, 3 Feb 2020 15:42:28 +0000 (15:42 +0000)
committerColin Walters <walters@verbum.org>
Mon, 3 Feb 2020 16:57:24 +0000 (16:57 +0000)
See https://github.com/jlebon/coreos-ci

This is just a start to test, cut down from the rpm-ostree version.

.cci.jenkinsfile [new file with mode: 0644]
ci/ci-commitmessage-submodules.sh

diff --git a/.cci.jenkinsfile b/.cci.jenkinsfile
new file mode 100644 (file)
index 0000000..9acb34c
--- /dev/null
@@ -0,0 +1,36 @@
+// See https://github.com/jlebon/coreos-ci
+// This was originally copied from the rpm-ostree one
+@Library('github.com/coreos/coreos-ci-lib@master') _
+
+COSA_IMAGE = 'quay.io/coreos-assembler/coreos-assembler:latest'
+COSA_BUILDROOT_IMAGE = 'registry.svc.ci.openshift.org/coreos/cosa-buildroot:latest'
+
+stage("Build") {
+parallel rpms: {
+  coreos.pod(image: COSA_BUILDROOT_IMAGE, runAsUser: 0) {
+      checkout scm
+      sh """
+        set -xeuo pipefail
+        # fetch tags so `git describe` gives a nice NEVRA when building the RPM
+        git fetch origin --tags
+        git submodule update --init
+
+        env NOCONFIGURE=1 ./autogen.sh
+        ./configure --with-openssl --with-curl --with-selinux
+        make
+      """
+  }
+},
+codestyle: {
+  coreos.pod(image: COSA_IMAGE) {
+      checkout scm
+      sh """
+        set -xeuo pipefail
+        # Jenkins by default only fetches the branch it's testing. Explicitly fetch master
+        # for ci-commitmessage-submodules.sh
+        git fetch origin +refs/heads/master:refs/remotes/origin/master
+        ci/ci-commitmessage-submodules.sh
+      """
+  }
+}
+}
index 38481aaf43d4b867b67d453484f2cc42f052922d..35d828e49b28094e325ecee6df917a9e4081e7c9 100755 (executable)
@@ -29,8 +29,10 @@ cleanup_tmp() {
 }
 trap cleanup_tmp EXIT
 
-pkg_upgrade
-pkg_install git
+if ! [ -x /usr/bin/git ]; then
+    pkg_upgrade
+    pkg_install git
+fi
 
 gitdir=$(realpath $(pwd))
 # Create a temporary copy of this (using cp not git clone) so git doesn't